<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>存档清单历史版本列表</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-body">
                    <form id="queryForm" onsubmit="return false;">
                        <input type="hidden" th:value="${id}" id="fileSheetId" name="id">
                    </form>
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table;
    /** 计划单列表 */
    $(function () {
        table = js.table.init({
            url: ctx + "create/file/list/history/list",
            showExport: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "项目编号", field: 'proCode'},
                {title: "项目名称", field: 'proName',width: '260px'},
                {title: "项目数量", field: 'proNum'},
                {title: "类型", field: 'special'},
                {title: "部分", field: 'part'},
                {title: "创建人", field: 'createNameOne'},
                {title: "清单状态", field: 'status',
                    formatter: function (value, row) {
                         if(value ===5 && row.designStatus ===1 && row.fileSignStatus === 1) {
                            return '<span class="badge label-success">已签收</span>';
                        } else {
                            return "无状态";
                        }
                    }
                },
                // {title: "驳回原因", field: 'rejectReason',width: '100px'},
                {title: "提报日期", field: 'createTime'},
                {title: "批准日期", field: 'verifyTime'},
                {
                    title: "操作",
                    // width: '160px',
                    formatter: function (value, row) {
                        let actions = [];
                            actions.push('<a class="btn btn-info btn-xs" target="_blank" href="' + ctx + 'create/file/list/historyPlan/' + row.id + '" > 查看</a>');
                        return actions.join('');
                    }
                }
            ]
        });

    });
</script>
</body>
</html>
